<template>
	<view class="">

		<view class="foster-list">
			<view class="foster-list-msg" v-for="(item,index) in bastList">
				<view class="foster-list-msg-img">
					<image :src='item.image' mode=""></image>
				</view>
				<view class="foster-list-msg-list" v-if="type=='1'">
					<view class="foster-list-msg-list-msg1">{{item.storeName}}</view>
					<view class="foster-list-msg-list-msg2">已认养 {{item.sales}}</view>
					<view class="foster-list-msg-list-msg3">{{item.unitName}}</view>
					<view class="foster-list-msg-list-msg4 dis">
						<view class="foster-list-msg-list-msg4-left">
							<text style="font-size: 20rpx;">¥</text>
							{{item.price}}
						</view>
						<view class="foster-list-msg-list-msg4-right">
							<image src="../../../static/logo.png" mode=""></image>

						</view>
					</view>
				</view>
				<view class="foster-list-msg-list" v-if="type=='2'">
					<view class="foster-list-msg-list-msg1">{{item.storeName}}</view>
					<view class="foster-list-msg-list-msg2">已售 {{item.sales}}</view>

					<view class="foster-list-msg-list-msg4 dis">
						<view class="foster-list-msg-list-msg4-left">
							<text style="font-size: 24rpx;">团购价¥</text>
							{{item.price}}
						</view>
						<view class="foster-list-msg-list-msg4-right">
							<image src="../../../static/logo.png" mode=""></image>

						</view>
					</view>
				</view>

			</view>
		</view>

	</view>
</template>

<script>
	import {
		mapGetters
	} from "vuex";
	import {
		goShopDetail
	} from '@/libs/order.js'
	export default {
		data() {
			return {

			}
		},
		computed: mapGetters(['uid']),
		props: {
			status: {
				type: Number,
				default: 0,
			},
			type: {
				type: String,
				default: '',
			},
			bastList: {
				type: Array,
				default: function() {
					return [];
				}
			}
		},
		methods: {
			goDetail(item) {
				goShopDetail(item, this.uid).then(res => {
					uni.navigateTo({
						url: `/pages/activity/goods_details/index?id=${item.id}`
					})
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.foster-list {
		width: 100%;
		display: flex;
		justify-content: space-between;
		flex-wrap: wrap;

		.foster-list-msg {
			.foster-list-msg-list {
				padding: 0 10rpx;

				.foster-list-msg-list-msg1 {
					font-size: 26rpx;
					color: #333;
					height: 100rpx;
					margin-top: 20rpx;
					overflow: hidden;
					text-overflow: ellipsis;
					display: -webkit-box;
					-webkit-line-clamp: 3;
					/* 限制在三行 */
					-webkit-box-orient: vertical;
				}

				.foster-list-msg-list-msg2 {
					font-size: 24rpx;
					color: #999;
					margin-top: 20rpx;
				}

				.foster-list-msg-list-msg4 {
					margin: 20rpx 0;
					justify-content: space-between;

					.foster-list-msg-list-msg4-left {
						font-size: 34rpx;
						color: $maincolor;
					}

					.foster-list-msg-list-msg4-right {
						width: 60rpx;
						height: 44rpx;

						image {
							width: 100%;
							height: 100%;
						}
					}
				}

				.foster-list-msg-list-msg3 {
					width: 120rpx;
					text-align: center;
					font-size: 20rpx;
					border-radius: 8rpx;
					opacity: 1;
					margin-top: 20rpx;
					padding: 2rpx 9rpx;
					border: 1px solid $maincolor;
				}
			}

			width: 47%;
			margin: 20rpx 0;

			background: #FFFFFF;
			box-shadow: 0px 4px 10px 0px rgba(202, 202, 202, 0.302);
			border-radius: 10rpx;
			opacity: 1;

			.foster-list-msg-img {
				height: 270rpx;

				image {
					width: 100%;
					height: 100%;
				}
			}
		}
	}
</style>